<div class="modal-dialog modal-lg">
    <div class="modal-content animated fadeIn">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">
                <span aria-hidden="true">&times;</span>
                <span class="sr-only">Close</span>
            </button>
            <h4 class="modal-title">公众号「{$data.name}」对接信息</h4>
        </div>
        <div class="modal-body">
            <table class="table table-bordered table-hover">
                <tbody>
                    <tr>
                        <td>服务器地址:</td>
                        <td>{$data.url}</td>
                        <td>
                            <button class="btn btn-xs btn-dark" data-clipboard-text="{$data.url}">复制</button>
                        </td>
                    </tr>
                    <tr>
                        <td>令牌:</td>
                        <td>{$data.token}</td>
                        <td>
                            <button class="btn btn-xs btn-dark" data-clipboard-text="{$data.token}">复制</button>
                        </td>
                    </tr>
                    <tr>
                        <td>消息加解密密钥:</td>
                        <td>{$data.encode_asc_key}</td>
                        <td>
                            <button class="btn btn-xs btn-dark" data-clipboard-text="{$data.encode_asc_key}">复制</button>
                        </td>
                    </tr>
                    <tr>
                        <td>服务器ip:</td>
                        <td>{$data.ip}</td>
                        <td>
                            <button class="btn btn-xs btn-dark" data-clipboard-text="{$data.ip}">复制</button>
                        </td>
                    </tr>
                </tbody>
            </table>
            <p class="text-warning">登录<a href="https://mp.weixin.qq.com/" target="_blank">公众号管理后台</a>进入「基本配置」->「服务器配置」填写,配置完成后别忘记启用。</p>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
        </div>
    </div>
</div>
<script>
    $(function(){
        var clipboard = new ClipboardJS('.btn',{container: document.getElementById('commonModal')});
        clipboard.on('success', function(e) {
            layer.msg('复制成功');
            e.clearSelection();
        });
        clipboard.on('error', function() {
            layer.msg('复制失败,请尝试手动复制');
        });
    });
</script>
